create sequence c_clients_seq;
create sequence c_dishes_seq;
create sequence c_carts_seq;
create sequence c_orders_seq;
create table c_clients(cId number primary key,cUsername varchar2(40),cPassword varchar2(40));
create table c_dishes(dId number primary key,dName varchar2(100),dPrice number(6,2),dPic varchar2(200));
create table c_carts(cartId varchar2(40) primary key,cId number);
create table c_orders(oId varchar2(40) primary key,time Date,sumPrice number(11,2),totalnum number,cId number);
create table carts_dishes(cdId varchar2(40) primary key,num number,dId number,cartId varchar2(40));
create table orders_dishes(odId varchar2(40) primary key,num number,dId number,oId varchar2(40));


--添加商品
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'包子红豆粥',6,'images/b1.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'方包芝麻糊',8,'images/b2.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'苹果番薯粥',9,'images/b3.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'草莓皮蛋粥',12,'images/b4.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'炒饭小米粥',15,'images/b5.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'橙子红豆粥',10,'images/b6.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'西兰花紫菜蛋汤',9,'images/b7.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'坚果小米粥',14,'images/b8.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'橙子炒面',10,'images/b9.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'炒面红豆粥',12,'images/b10.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'鸡蛋可可',10,'images/b11.jpg');
insert into c_dishes(dId,dName,dPrice,dPic) values(c_dishes_seq.nextval,'草莓小米粥',13,'images/b12.jpg');

--添加用户
drop table c_client;
drop table c_carts;
drop table c_orders
drop table carts_dishes
drop table orders_dishes
select * from c_clients;
select * from carts_dishes;
 1469974334424668   1  12 1469974334424787
